import React, { Component } from 'react'

class EventBind3 extends Component {
    constructor() {
        super()
    
        this.state = {
             message: 'Hello'
        }

        this.clickHandler = this.clickHandler.bind(this)
    }
    clickHandler() {
        this.setState({
            message: 'Goodbye'
        })
    }
    render() {
        return (
            <div>
                <div>{this.state.message}</div>       
                <button onClick={this.clickHandler}>change</button>         
            </div>
        )
    }
}

export default EventBind3
